package com.maven.blog.config;


import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


// 统一异常处理
@ResponseBody
@ControllerAdvice
public class ErrorAdvice {


    @ExceptionHandler(Exception.class)
    public String error(Exception e) {
        return e.getMessage();
    }
}
